package com.fulu.netty.luban.flrpc.server.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class StudentServiceImpl implements StudentService {

    private static final Map<String, String> stus = new HashMap<>();

    static {
        stus.put("a", "张三");
        stus.put("b", "李四");
        stus.put("c", "王五");
    }

    @Override
    public List<String> getNames(String id) {
        ArrayList<String> objects = new ArrayList<>();
        if(id != null) {
            objects.add(stus.get(id));
        }else{
            objects.addAll(stus.values());
        }
        return objects;
    }
}
